
import 'package:flutter/cupertino.dart';
import 'package:hitutor/UI/HiNote/TeachMaterial/TeachMaterialList.dart';
import 'package:hitutor/Util/PageUtil.dart';
import 'package:hitutor/Widget/MyBgPage.dart';

import '../../VideoPlayerPage.dart';

class RecordList extends StatefulWidget {
  List<dynamic> classedUrls = [];

  RecordList(this.classedUrls);

  @override
  State<StatefulWidget> createState() {
    return _RecordList();
  }
}

class _RecordList extends State<RecordList> {
  @override
  Widget build(BuildContext context) {
    return MyBgPage(
        "",
        Container(
            child: ListView.builder(
                padding: EdgeInsets.fromLTRB(0, 8, 0, 16),
                itemCount: widget.classedUrls.length,
                itemBuilder: (BuildContext context, int index) {
                  return ItemMaterial(true, widget.classedUrls[index]["fileName"], onTap: () {
                    PageUtil().open(context, VideoPlayerPage(widget.classedUrls[index]["url"]));
                  });
                })));
  }
}
